<script setup lang="ts">
import { ref } from "vue";
import { deviceItem } from "@/type/destribute.ts";

const dialogDeviceDetailVisible = ref(false)
const deviceDetail = ref<deviceItem>()

const init = (row: any) => {
  deviceDetail.value = row
  dialogDeviceDetailVisible.value = true
}

defineExpose({
  init
})
</script>

<template>
  <!--  详情对话框-->
  <el-dialog :close-on-click-modal="false" v-model="dialogDeviceDetailVisible" title="设备详情">
    <div class="dialog-item">
      <span>名称：</span>
      <span>{{ deviceDetail?.name }}</span>
    </div>
    <div class="dialog-item">
      <span>购买时间：</span>
      <span>{{ deviceDetail?.purchaseDate }}</span>
    </div>
    <div class="dialog-item">
      <span>价格：</span>
      <span>{{ deviceDetail?.purchasePrice }}</span>
    </div>
    <div class="dialog-item">
      <span>型号：</span>
      <span>{{ deviceDetail?.serialNumber }}</span>
    </div>
    <div class="dialog-item">
      <span>状态：</span>
      <span>{{ deviceDetail?.status }}</span>
    </div>
  </el-dialog>
</template>

<style scoped lang="scss">

</style>
